﻿create proc [dbo].[Spm_InsertErrorItem]
@uid int=0,
@tid int=0
as
if exists(select 1 from ErrorItem where uid=@uid and tid=@tid)
begin
	update ErrorItem set total=total+1,errortotal=errorrate+1,errorrate=errortotal/total where uid=@uid and tid=@tid
end
else
begin
	insert into ErrorItem (tid,uid) values (@tid,@uid)
end